package com.googlecode.connectlet.crypto.cipher.mode;

import com.googlecode.connectlet.crypto.cipher.Encipheror;

public class CbcPkcs5PaddingEncipheror extends CbcNoPaddingEncipheror {
	private Pkcs5PaddingEncipherorFinal finalBlock = new Pkcs5PaddingEncipherorFinal(this);

	public CbcPkcs5PaddingEncipheror(Encipheror cipher) {
		super(cipher);
	}

	public CbcPkcs5PaddingEncipheror(Encipheror cipher, byte[] iv) {
		this(cipher);
		init(iv);
	}

	@Override
	public int doFinal(byte[] output, int outputOffset) {
		return finalBlock.doFinal(output, outputOffset);
	}
}